package com.hmc.modules.sjfx.service.tpmmmea.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hmc.common.service.impl.CrudServiceImpl;
import com.hmc.common.constant.Constant;
import com.hmc.modules.sjfx.dao.tpmmmea.TpmmmeaDao;
import com.hmc.modules.sjfx.dto.sjfx.SphAndWglhDTO;
import com.hmc.modules.sjfx.dto.tpmmmea.TpmmmeaDTO;
import com.hmc.modules.sjfx.entity.tpmmmea.TpmmmeaEntity;
import com.hmc.modules.sjfx.service.tpmmmea.TpmmmeaService;
import com.hmc.modules.security.user.SecurityUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;

import static java.util.stream.Collectors.collectingAndThen;
import static java.util.stream.Collectors.toCollection;

/**
 * 高频上料实绩表
 *
 * @author hmc wengxiulinluman@qq.com
 * @since 3.0 2024-01-12
 */
@Service
public class TpmmmeaServiceImpl extends CrudServiceImpl<TpmmmeaDao, TpmmmeaEntity, TpmmmeaDTO> implements TpmmmeaService {

    @Autowired
    private TpmmmeaDao tpmmmeaDao;

    @Override
    public QueryWrapper<TpmmmeaEntity> getWrapper(Map<String, Object> params){
        QueryWrapper<TpmmmeaEntity> wrapper = new QueryWrapper<>();


        return wrapper;
    }


    /**
     * 查询高频上料实绩表试批号SAMPLE_LOT_NO和外购炉号ORIGIN_HEAT_NO
     * @return
     */
    @Override
    public List<SphAndWglhDTO> queryTpmmmbaBySphAndWglhEA() {
        List<SphAndWglhDTO> sphAndWglhDTOS = tpmmmeaDao.queryTpmmmbaBySphAndWglhEA();
//        List<SphAndWglhDTO> collect = sphAndWglhDTOS.stream().collect(collectingAndThen(toCollection(() -> new TreeSet<>(Comparator.comparing(SphAndWglhDTO::getSampleLotNo))), ArrayList::new));
        return sphAndWglhDTOS;
    }
}